home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1999 / MacHack 1999.toast / The Hacks / LiveFastStartServer / Open Transport 1.3 / Includes / CIncludes / OpenTptISDN.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-30  |  6.6 KB  |  236 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        OpenTptISDN.h
  3.  
  4.     Contains:    Definitions for ISDN.  This file is a first draft at definitions
  5.                 for ISDN.  ISDN modules may also want to support serial framing 
  6.                 definitions and IOCTLs for "spoofing" purposes.
  7.  
  8.     Copyright:    © 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10. */
  11.  
  12. #ifndef __OPENTPTISDN__
  13. #define __OPENTPTISDN__
  14.  
  15. #ifndef __OPENTPTSERIAL__
  16. #include <OpenTptSerial.h>
  17. #endif
  18.  
  19. /*******************************************************************************
  20. ** Module Definitions
  21. ********************************************************************************/
  22. //
  23. // XTI Level
  24. //
  25. enum
  26. {
  27.     COM_ISDN    = 'ISDN'
  28. };
  29.  
  30. //
  31. // Module Names
  32. //
  33. #define kISDNName        "isdn"
  34.  
  35. enum
  36. {
  37.     kISDNModuleID    = 7300
  38. };
  39. //
  40. // ISDN framing methods, set using the I_OTSetFramingType IOCTL
  41. //
  42. enum
  43. {
  44.     kOTISDNFramingTransparentSupported    = 0x0010,    /* Support Transparent mode         */
  45.     kOTISDNFramingHDLCSupported            = 0x0020,    /* Support HDLC Synchronous mode     */
  46.     kOTISDNFramingV110Supported            = 0x0040,    /* Support V.110 Asynchronous mode     */
  47.     kOTISDNFramingV14ESupported            = 0x0080    /* Support V.14 Asynchronous mode     */
  48. };
  49.  
  50.  
  51. /*******************************************************************************
  52. ** Miscellaneous equates
  53. ********************************************************************************/
  54. /*
  55.  * Disconnect reason codes (from Q.931)
  56.  */
  57. enum
  58. {
  59.     kOTISDNUnallocatedNumber                        = 1,
  60.     kOTISDNNoRouteToSpecifiedTransitNetwork            = 2,
  61.     kOTISDNNoRouteToDestination                        = 3,
  62.     kOTISDNChannelUnacceptable                        = 6,
  63.     kOTISDNNormal                                     = 16,
  64.     kOTISDNUserBusy                                 = 17,
  65.     kOTISDNNoUserResponding                         = 18,
  66.     kOTISDNNoAnswerFromUser                            = 19,
  67.     kOTISDNCallRejected                             = 21,
  68.     kOTISDNNumberChanged                             = 22,
  69.     kOTISDNNonSelectedUserClearing                    = 26,
  70.     kOTISDNDestinationOutOfOrder                    = 27,
  71.     kOTISDNInvalidNumberFormat                        = 28,
  72.     kOTISDNFacilityRejected                            = 29,
  73.     kOTISDNNormalUnspecified                        = 31,
  74.     kOTISDNNoCircuitChannelAvailable                = 34,
  75.     kOTISDNNetworkOutOfOrder                        = 41,
  76.     kOTISDNSwitchingEquipmentCongestion                = 42,
  77.     kOTISDNAccessInformationDiscarded                = 43,
  78.     kOTISDNRequestedCircuitChannelNotAvailable        = 44,
  79.     kOTISDNResourceUnavailableUnspecified            = 45,
  80.     kOTISDNQualityOfServiceUnvailable                = 49,
  81.     kOTISDNRequestedFacilityNotSubscribed            = 50,
  82.     kOTISDNBearerCapabilityNotAuthorized            = 57,
  83.     kOTISDNBearerCapabilityNotPresentlyAvailable    = 58,
  84.     kOTISDNCallRestricted                            = 59,
  85.     kOTISDNServiceOrOptionNotAvilableUnspecified    = 63,
  86.     kOTISDNBearerCapabilityNotImplemented            = 65,
  87.     kOTISDNRequestedFacilityNotImplemented            = 69,
  88.     kOTISDNOnlyRestrictedDigitalBearer                = 70,
  89.     kOTISDNServiceOrOptionNotImplementedUnspecified    = 79,
  90.     kOTISDNCallIdentityNotUsed                        = 83,
  91.     kOTISDNCallIdentityInUse                        = 84,
  92.     kOTISDNNoCallSuspended                            = 85,
  93.     kOTISDNCallIdentityCleared                        = 86,
  94.     kOTISDNIncompatibleDestination                    = 88,
  95.     kOTISDNInvalidTransitNetworkSelection            = 91,
  96.     kOTISDNInvalidMessageUnspecified                = 95,
  97.     kOTISDNMandatoryInformationElementIsMissing        = 96,
  98.     kOTISDNMessageTypeNonExistentOrNotImplemented    = 97,
  99.     kOTISDNInterworkingUnspecified                    = 127
  100. };
  101.  
  102. /*******************************************************************************
  103. ** OTISDNAddress
  104. **
  105. **        The OTISDNAddress has the following format:
  106. **
  107. **        "xxxxxx*yy"
  108. **
  109. **        where 'x' is the phone number and 'y' is the sub address (if available
  110. **        in the network. The characters are coded in ASCII (IA5), and valid
  111. **        characters are: '0'-'9','#','*'.
  112. **        The max length of the each phone number is 21 characters (?) and the max
  113. **        subaddress length is network dependent.
  114. **        When using bonded channels the phone numbers are separated by '&'.
  115. **        The X.25 user data is preceded by '@'.
  116. ********************************************************************************/
  117.  
  118. enum
  119. {
  120.     AF_ISDN                = 0x2000
  121. };
  122.  
  123. enum
  124. {
  125.     kOTISDNMaxPhoneSize = 32,
  126.     kOTISDNMaxSubSize = 4
  127. };
  128.  
  129. struct OTISDNAddress
  130. {
  131.     OTAddressType    fAddressType;
  132.     UInt16            fPhoneLength;
  133.     char            fPhoneNumber[kOTISDNMaxPhoneSize+1+kOTISDNMaxSubSize];    
  134. };
  135. typedef struct OTISDNAddress OTISDNAddress;
  136.  
  137. /*******************************************************************************
  138. ** IOCTL Calls for ISDN
  139. ********************************************************************************/
  140.  
  141. enum
  142. {
  143.     MIOC_ISDN    = MIOC_SRL        /* ISDN ioctl() cmds */
  144. };
  145.  
  146. enum
  147. {
  148.     /* 
  149.      * Send or receive an ALERTING message
  150.      */
  151.     I_OTISDNAlerting = MIOC_CMD(MIOC_ISDN, 100),
  152.  
  153.     /* 
  154.      * Send a SUSPEND message
  155.      * The parameter is the Call Identity (Maximum 8 octets)
  156.      */
  157.     I_OTISDNSuspend = MIOC_CMD(MIOC_ISDN, 101),
  158.  
  159.     /* 
  160.      * Receive a SUSPEND ACKNOWLEDGE message
  161.      */
  162.     I_OTISDNSuspendAcknowledge = MIOC_CMD(MIOC_ISDN, 102),
  163.  
  164.     /* 
  165.      * Receive a SUSPEND REJECT message
  166.      */
  167.     I_OTISDNSuspendReject = MIOC_CMD(MIOC_ISDN, 103),
  168.     
  169.     /* 
  170.      * Send a RESUME message
  171.      * The parameter is the Call Identity (Maximum 8 octets)
  172.      */
  173.     I_OTISDNResume = MIOC_CMD(MIOC_ISDN, 104),
  174.  
  175.     /* 
  176.      * Receive a RESUME ACKNOWLEDGE message
  177.      */
  178.     I_OTISDNResumeAcknowledge = MIOC_CMD(MIOC_ISDN, 105),
  179.  
  180.     /* 
  181.      * Receive a RESUME REJECT message
  182.      */
  183.     I_OTISDNResumeReject = MIOC_CMD(MIOC_ISDN, 106),
  184.     
  185.     /* 
  186.      * Send or receive a FACILITY message
  187.      */
  188.     I_OTISDNFaciltity = MIOC_CMD(MIOC_ISDN, 107)
  189.     
  190. };
  191.  
  192. /*******************************************************************************
  193. ** Connect user data size
  194. ********************************************************************************/
  195.  
  196. enum
  197. {
  198.     kOTISDNMaxUserDataSize = 32
  199. };
  200.  
  201. /*******************************************************************************
  202. ** Option management calls for ISDN
  203. ********************************************************************************/
  204.  
  205. enum
  206. {
  207.     ISDN_OPT_COMMTYPE                = 0x0200,
  208.         kOTISDNTelephoneALaw            = 1,                /* G.711 A-law                         */
  209.         kOTISDNTelephoneMuLaw            = 26,                /* G.711 µ-law                         */
  210.         kOTISDNDigital64k                = 13,                /* unrestricted digital (default)     */
  211.         kOTISDNDigital56k                = 37,                /* user rate 56Kb/s                 */
  212.         kOTISDNVideo64k                    = 41,                /* video terminal at 64Kb/s         */
  213.         kOTISDNVideo56k                    = 42,                /* video terminal at 56Kb/s         */
  214.     
  215.     ISDN_OPT_FRAMINGTYPE            = 0x0201,
  216.         kOTISDNFramingTransparent        = 0x0010,            /* Transparent mode                 */
  217.         kOTISDNFramingHDLC                = 0x0020,            /* HDLC synchronous mode (default)    */
  218.         kOTISDNFramingV110                = 0x0040,            /* V.110 asynchronous mode             */
  219.         kOTISDNFramingV14E                = 0x0080,            /* V.14E asynchronous mode            */
  220.     
  221.     ISDN_OPT_56KADAPTATION            = 0x0202,
  222.         kOTISDNNot56KAdaptation            = false,            /* not 56K Adaptation (default)        */
  223.         kOTISDN56KAdaptation            = true                /* 56K Adaptation                    */
  224. };
  225.  
  226.  
  227. /* Default options, you do not need to set these */
  228. enum 
  229. {
  230.     kOTISDNDefaultCommType        = kOTISDNDigital64k,
  231.     kOTISDNDefaultFramingType    = kOTISDNFramingHDLC,
  232.     kOTISDNDefault56KAdaptation    = kOTISDNNot56KAdaptation
  233. };
  234.  
  235. #endif
  236.